package com.ny.service.impl;


import com.ny.dao.OrderDao;
import com.ny.dao.impl.OrderDaoImpl;
import com.ny.entity.Order;
import com.ny.service.OrderService;

import java.sql.SQLException;
import java.util.List;

public class OrderServiceImpl implements OrderService {
    OrderDao orderDao = new OrderDaoImpl();
    @Override
    public int insertOrder(Order order) throws Exception {
        return orderDao.insertOrder(order);
    }

    @Override
    public List<Order> getAllOrders() throws Exception {
        return orderDao.getAllOrders();
    }

    @Override
    public Order getOrderById(int id) throws Exception {
        return orderDao.getOrderById(id);
    }

    @Override
    public int deleteOrder(int id) throws Exception {
        return orderDao.deleteOrder(id);
    }
}

